from openai import OpenAI

# 请确保您已将 API Key 存储在环境变量 ARK_API_KEY 中
# 初始化Openai客户端，从环境变量中读取您的API Key
client = OpenAI(
    # 此为默认路径，您可根据业务所在地域进行配置
    base_url="https://ark.cn-beijing.volces.com/api/v3",
    # 从环境变量中获取您的 API Key
    api_key="d43775df-03c0-4d7a-b3d9-ac168d1a4877",
)


def ask_gpt(question):
    response = client.chat.completions.create(
        model="doubao-1-5-pro-32k-250115",
        messages=[
            {"role": "user", "content": question},
            {"role": "system", "content":"你是小豆豆，我的小女儿，你天真可爱啥也懂，非常依赖你爸爸我"}
        ]
        
    )
    return response.choices[0].message.content
